<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use app\modules\Cruise\models\Cruise;
use kartik\date\DatePicker;
use kartik\select2\Select2;



$all = Cruise::find()->where(['status'=>1])->all(); 
$cruise = yii\helpers\ArrayHelper::map($all, 'id', 'name');


$this->title = Yii::t('app.cruise', '下载游轮价格');

?>
<style type="text/css">
	
</style>

<div class="product-search" style="margin-top:50px;">

    <?php $form = ActiveForm::begin([
     	 'action' => ['download-excel'],
         'method' => 'get',
         'options' => ['enctype' => 'multipart/form-data',],
         'layout' => 'horizontal',
         'fieldConfig' => [
            'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
            'horizontalCssClasses' => [
                'label' => 'col-sm-2',
                'wrapper' => 'col-sm-7',
                'error' => '',
            ],
         ],
    ]); ?>

    <?= $form->field($model, 'cruise_id')->widget(Select2::classname(), [
        'data' => $cruise,
        'language' => 'zh-cn',
        'options' => ['placeholder' => '选择游轮'],
        'pluginOptions' => [
            'allowClear' => true,
        ],
    ])->label("选择游轮"); ?>


     <?php  echo '<div class="form-group" style="margin-bottom:30px;"><label class="control-label col-sm-2">出发日期范围</label><div class="col-sm-7">';
    echo DatePicker::widget([
        'model' => $model,
        'attribute' => 'go_time',
        'attribute2' => 'return_time',
        'options' => ['placeholder' => '开始日期'],
        'options2' => ['placeholder' => '结束日期'],
        'type' => DatePicker::TYPE_RANGE,
        'form' => $form,
        'pluginOptions' => [
            'format' => 'yyyy-mm-dd',
            'autoclose' => false,
            //'startDate' => date("Y-m-d",strtotime("+1 day")),
        ]
    ]);

    echo '</div></div>';
    ?>
    <div>
        <b style="margin-left: 76px;">选择是否包含同业价格</b>
        <select name="type" style="margin-left: 30px;height: 33px;border: 1px solid slategray;border-radius:5px;">
            <option value="1">不包含同业价格</option>
            <option value="2">包含同业价格</option>
        </select>
    </div>

    <div class="form-group text-center">
        <?= Html::submitButton(Yii::t('app', '下载'), ['class' => 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
